package com.jlcindia.hibernate;


import java.util.List;

import com.jlcindia.dao.CustomerDAO;
import com.jlcindia.dao.DAOFactory;

public class Lab44 {
	public static void main(String args[]) {
		CustomerDAO cdao = DAOFactory.getCustomerDAO();
		System.out.println("All Customers");
	
		List<Customer> list = cdao.getAllCustomers();
		for (Customer c : list) {
			System.out.println(c);
		}
		
		System.out.println("All Customers");
		list = cdao.getAllCustomers(0, 4);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by city");
		list = cdao.getCustomersByCity("Blore");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by city 0,3");
		list = cdao.getCustomersByCity("Blore",0,3);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by cardType");
		list = cdao.getCustomersByCardType("Amex");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by cardType 0,2");
		list = cdao.getCustomersByCardType("Amex",0,2);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Bal");
		list = cdao.getCustomersByBal(13000.0);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Bal 0,1");
		list = cdao.getCustomersByBal(13000.0,0,1);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Status");
		list = cdao.getCustomersByStatus("Active");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Status 0,3");
		list = cdao.getCustomersByStatus("Active",0,3);
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Name");
		list = cdao.getCustomersByName("xx");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by city,cardType");
		list = cdao.getCustomers("Blore","Amex");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by city,cardType,status");
		list = cdao.getCustomers("Blore","Visa","Active");
		for (Customer customer : list) {
			System.out.println(customer);
		}
		
		System.out.println("Customers by Email");
		Customer customer = (Customer)cdao.getCustomerByEmail("ss");
			System.out.println(customer);
			
		System.out.println("Customers by accno");
		customer = (Customer)cdao.getCustomerByCardNo(12345);
			System.out.println(customer);
		
	}
}
